if (FALSE) {
library(EMCluster, quietly = TRUE)
library(MASS, quietly = TRUE)
set.seed(1234)
### Crabs.
x <- as.matrix(crabs[, 4:8])
ret <- init.EM(x, nclass = 4, min.n = 20)
ret.proj <- project.on.2d(x, ret)
### Plot.
pdf("crabs_ppcontour.pdf", height = 5, width = 5)
plotppcontour(ret.proj$da, ret.proj$Pi, ret.proj$Mu, ret.proj$S,
ret.proj$class, angle = pi/6, main = "Crabs K = 4")
dev.off()
}
Run the code above in your browser using DataLab